package com.hyz.controller;

import com.hyz.model.dto.ApprovalResultRequest;
import com.hyz.model.vo.AssetSecondmentResponse;
import com.hyz.service.permission.InformationService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import pojo.ResponseResult;

import java.util.List;

/**
 * @author HGD
 * @date 2022/10/9 19:17
 */
@Api("信息管理经理")
@RestController
@RequestMapping("/information")
@PreAuthorize("hasAnyAuthority('rights','information')")
public class InformationController {
    @Autowired
    private InformationService ifService;

    @ApiOperation("信息管理经理获取调用申请")
    @PostMapping("/ifGetAssetSecondments")
    public ResponseResult<List<AssetSecondmentResponse>> ifGetAssetSecondments() {
        return ifService.ifGetAssetSecondments();
    }

    @ApiOperation("信息管理经理审批调用申请")
    @PostMapping("/ifUpdateAssetSecondment")
    public ResponseResult<List<AssetSecondmentResponse>> ifUpdateAssetSecondment(@RequestBody ApprovalResultRequest request) {
        return ifService.ifUpdateAssetSecondment(request);
    }
}
